#include<stdio.h>
#include<time.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char const *argv[])
{
    while (1)
    {
        system("clear");
        time_t current_time;
        time(&current_time);
        struct tm *l_time = localtime(&current_time);
        printf("现在是北京时间:\n");
        printf("%d年%d月%d日\n", l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday);
        printf("%d时%d分%d秒\n", l_time->tm_hour, l_time->tm_min, l_time->tm_sec);
        sleep(1);
    }
    return 0;
}
